<template>
	<view style="padding: 30rpx;"> 
		<view class="userBox" v-for="(item, index) in history" :key="index" @click="goNoteView(item.note_id, item.file)" >
			<text>
				标题：<text style="font-weight: bold;">{{ item.title }}</text>
			</text>
			
			<text style="margin-top: 2%;">
				摘要：<text style="color: gray; word-wrap: break-word;">{{ item.summary }}</text>
			</text>
			
			<text style="margin-top: 2%;">
				修改日期：<text>{{ item.create_time }}</text>
			</text>
		</view>
	</view>
</template>

<script>
	import config from '@/config.js';
	export default {
		data() {
			return {
				history:[
					{title:"biaoti", summary:"zhaiyao", create_time:"yyyy/mm/dd"},
					{title:"biaoti", summary:"zhaiyao13", create_time:"yyyy/mm/dd"},
					{title:"biaoti", summary:"zhaiyao", create_time:"yyyy/mm/dd"},
				],
			}
		},
		
		onLoad(option) {
			let that = this;
			uni.request({
				url: config.baseUrl + '/note/findAll?noteId=' + option.noteId,
				method: 'GET',
				success(res) {
					that.history = res.data,
					console.log("+++++++++++++++++++++++++++++++++++++++++")
					console.log(res.data)
				}	
			})
		},
		
		methods: {
			goNoteView(noteId, fileName){
				uni.navigateTo({
					url:'/pages/noteView/noteView?noteId=' + noteId + '&FileName=' + fileName
				})
			},
		}
	}
</script>

<style scoped>
	.userBox {
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
		background-color: #fff;
		padding: 40rpx;
		border-radius: 30rpx;
		box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, .1);
		margin-bottom: 5%;
	}
	
</style>
